<?php
namespace Modules\Auth\Seeders;
use Illuminate\Database\Seeder;
use Modules\Auth\Models\User;
class UserSeeder extends Seeder{
    public function run(): void{
        //正常新增一个用户
        $user = User::create(['name' => 'admin','email' => 'admin@example.com','password' => bcrypt('123456'),]);
        // assignRole()向model_has_roles 表中插入记录，将用户与角色关联起来
        $user->assignRole('super-admin');
    }
}
